/**
 * \file Plugin.h
 * \brief Plugin declaration class
 * \author Edouard ROGE
 * \date 16 Mars 2013
 */
#ifndef _PLUGIN_
#define _PLUGIN_

#include "Core/Memory/HeapObject.h"
#include "PluginInterface.h"

class Plugin : public HeapObject
{
public:

	/**
	 * \enum Type
	 * \brief List all different kinds of plug-ins
	 */
	enum Type
	{
		Render=0,
		Sound,
		Count
	};

	/**
	 * \fn Plugin()
	 * \brief Default constructor
	 */
	Plugin();
	
	/**
	 * \fn virtual ~Plugin()
	 * \brief Destructor
	 */
	virtual ~Plugin();

	/**
	 * \fn PluginInterface * GetInterface() const
	 * \return Plug-in interface to get an access to the plug-in functions
	 * \brief Get the plug-in interface to get an access to the plug-in functions
	 */
	PluginInterface * GetInterface() const;
	
	/**
	 * \fn error Load(const String & _strPluginName) = 0;
	 * \param _strPluginName name of the plug-in to load
	 * \return an error if occurs
	 * \brief Load a Plugin
	 */
	virtual error Load(const String & _strPluginName) = 0;
	
	/**
	 * \fn error Unload() = 0;
	 * \return an error if occurs
	 * \brief Unload a Plugin
	 */
	virtual error Unload() = 0;

	/**
	 * \fn virtual Type GetPluginType() const = 0;
	 * \return Plug-in type
	 * \brief Get the plug-in type
	 */
	virtual Type GetPluginType() const = 0;

protected:

	/** Interface of the plug-in loaded */
	PluginInterface * m_pInterface;

};

#endif // _PLUGIN_
